package com.baizhi.controller;

import com.baizhi.factory.BeanFactory;
import com.baizhi.service.XxxService;
import com.baizhi.service.impl.XxxServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/removeXxx")
public class RemoveXxxController extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String id = req.getParameter("id");
        Integer ids=Integer.parseInt(id);

       // XxxService xxxService=new XxxServiceImpl();
        XxxService xxxService=((XxxService) BeanFactory.getBean("xxxService"));
        xxxService.removeXxxById(ids);

        req.getRequestDispatcher("/removeXxxOk.jsp").forward(req,resp);


    }
}
